// 返回医院数据
import request from "@/utils/request"

// 搜索获取医院数据
export const reqSearchHospital=(page,pageSize,hclass)=>{
  const url = `/api/hospital/search/${page}/${pageSize}/${hclass}`;
  return request({
    url: url,
    method: 'GET',
  });
}

// 获取不同分类下医院的数据
export const reqGetHosdetail=(page,pageSize,province,nature,level,hclass)=>{
  return request({
    url:'/api/hospital',
    method:'GET',
    params:{
      page:parseInt(page),
      pageSize:parseInt(pageSize),
      province,
      nature,
      level,
      hclass
    }
  })
}

// 获取当前科室的医生
export const reqGetDoctor=(sid)=>{
  const url=`/api/hospital/doctor/${sid}`
  return request({
    url:url,
    method:'GET'
  })
}

// 获取医院详细数据
export const reqGetHospitalinfo=(id)=>{
  return request({
    url:`/api/hospital/${id}`,
    method:'GET',
  })
}

// 获取当前医生的预约人数
export const reqGetdocNum=(did)=>{
  // url:'/api/doctor/getReserveNum/1',
  return request({
    url:`/api/doctor/getReserveNum/${did}`,
    method:'GET'
  })
}

// 获取当前医生剩余的可预约人数
export const reqGetRemainder=(did,time)=>{
  return request({
    url:`/api/user/checkCanReserve/${did}/${time}`,
    method:'GET',
  })
}